package com.bocai.freeman.view.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;

import com.bocai.freeman.R;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by win7 on 2016/5/20.
 */
public class PersonCenterMyAdapter extends BaseAdapter {
    private Context mContext;

    public PersonCenterMyAdapter(Context context) {
        this.mContext = context;
    }

    @Override
    public int getCount() {
        return 2;
    }

    @Override
    public Object getItem(int position) {
        return position;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder viewHolder;
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.item_person_center, null);
            viewHolder = new ViewHolder(convertView);
            convertView.setTag(viewHolder);
        } else {
            viewHolder = (ViewHolder) convertView.getTag();
        }
        return convertView;
    }


    static class ViewHolder {
        @Bind(R.id.btn_cancel_order)
        Button btnCancelOrder;
        @Bind(R.id.btn_pay_money)
        Button btnPayMoney;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
